# polls/templatetags/poll_extras.py
from django import template

register = template.Library()

COLORS = ['primary', 'success', 'info', 'warning', 'danger', 'secondary']

@register.filter
def get_color(index):
    return COLORS[index % len(COLORS)]

@register.filter
def get_color_hex(index):
    COLORS_HEX = ['#4e73df', '#1cc88a', '#36b9cc', '#f6c23e', '#e74a3b', '#858796']
    return COLORS_HEX[index % len(COLORS_HEX)]